﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MediaBrowser.Library.Persistance;
using System.IO;
using System.Globalization;
using MediaBrowser.Library.Extensions;
using MediaBrowser.Library.Configuration;
using MediaBrowser.Library.Localization;
using MediaBrowser.Library.Logging;

//***************************************************************************************************
//  This class is used to extend the string data used by MB.  It is localizable.
//  The most common use will be to provide description strings for config options.  To do this
//  define public string properties that are named the same as the label text of your options on your
//  config panel +desc.  A couple of examples have been generated by the template.
//***************************************************************************************************
namespace Chocolate
{
    [Serializable]
    public class MyStrings : LocalizedStringData
    {
        const string VERSION = "1.0001"; //this is used to see if we have changed and need to re-save

        //these are our strings keyed by property name
        public string ShowInfoIcons = "Show Info Icons";
        public string ShowInfoIconsBackgrounds = "Show Info Icon Background";
        public string SmallEhs = "Smaller EHS Icons";
        public string UseSeasonPoster = "Use Season Poster on EHS";
        public string AlwaysShowPoster = "Always Show Poster";
        public string ShowWeather = "Show Weather Panel on EHS";
        public string MaintainBackdropAR = "Backdrop Position";
        public string EnableVideoBackdrop = "Now Playing Backdrop";
        public string EnableStripBackdrop = "Strip Backdrop";
        public string EnableEHSBackdrop = "Recent Items Backdrops on EHS";
        public string EnableFolderBackdrop = "Folder Backdrop";
        public string Enable24hr = "Use 24 Hour Format";

        public string ChocolateOptionsDesc = "Options for the Chocolate Theme.";
        public string StripviewExpandedDesc = "Set whether the Strip view will be expanded by default.";
        public string ShowInfoIconsDesc = "Displays Info Icons at the top of the screen when browsing media.";
        public string ShowInfoIconsBackgroundsDesc = "Adds semi-transparent background to Info Icons.";
        public string UseSeasonPosterDesc = "Replace episode thumbs with season posters on the EHS (Enhanced Home Screen).";
        public string AlwaysShowPosterDesc = "When using non-widescreen displays, posters are disabled in some screens, enabling this option forces them on.";
        public string EnableVideoBackdropDesc = "Replaces the backdrop with the currently playing video.";
        public string MaintainBackdropARDesc = "Stretch recommended for non-widescreen backdrops.";
        public string EnableStripBackdropDesc = "The backdrop in Strip view slides back and fourth with navigation.";
        public string EnableEHSBackdropDesc = "The backdrop on the EHS rotates through the backdrops from the recent items of the currently selected folder.";
        public string EnableFolderBackdropDesc = "Adds Folder Backdrop tier between Fan Art and Initial Folder Background.";
        public string Enable24hrDesc = "Clock and End Time use 24 hour format.";

        public string Synopsis = "Synopsis";
        public string Director = "Director";
        public string Genres = "Genres";
        public string Year = "Year";
        public string Runs = "Runs";
        public string Ends = "Ends";
        public string Seasons = "Seasons";
        public string Episodes = "Episodes";
        public string Album = "Album";
        public string Artist = "Artist";
        public string Duration = "Duration";
        public string Players = "Players";
        public string Company = "Company";
        public string Released = "Released";
        public string CPU = "CPU";
        public string GPU = "GPU";
        public string POSTER = "POSTER";
        public string LIST = "LIST";
        public string COVERFLOW = "COVERFLOW";
        public string THUMB = "THUMB";
        public string STRIP = "STRIP";
        public string NAME = "NAME";
        public string DATE = "DATE";
        public string RATING = "RATING";
        public string RUNTIME = "RUNTIME";
        public string UNWATCHED = "UNWATCHED";
        public string YEAR = "YEAR";
        public string NONE = "NONE";
        public string ACTOR = "ACTOR";
        public string GENRE = "GENRE";
        public string DIRECTOR = "DIRECTOR";
        public string STUDIO = "STUDIO";
        public string CONFIG = "CONFIG";
        public string VIEW = "VIEW";
        public string SORT = "SORT";
        public string FILTER = "FILTER";
        public string CLOSE = "CLOSE";
        public string INCREASESIZE = "+ SIZE";
        public string DECREASESIZE = "- SIZE";
        public string BACKDROP = "BACKDROP";
        public string LABELS = "LABELS";
        public string VERTSCROLL = "VERT SCROLL";
        public string BANNERS = "BANNERS";
        public string PLAYALL = "PLAY ALL";
        public string QUEUEALL = "QUEUE ALL";
        public string PLAYRANDOM = "PLAY RANDOM";
        public string PLAYUNWATCHED = "PLAY UNWATCHED";
        public string Latest = "Latest";
        public string Watched = "Watched";
        public string Unwatched = "Unwatched";
        public string ENDS = "ENDS";
        public string RUNS = "RUNS";
        public string RESO = "RESO";
        public string VIDEO = "VIDEO";
        public string AUDIO = "AUDIO";

        public MyStrings() //for the serializer
        {
        }

        public static MyStrings FromFile(string file)
        {
            MyStrings s = new MyStrings();
            XmlSettings<MyStrings> settings = XmlSettings<MyStrings>.Bind(s, file);

            Logger.ReportInfo("Using String Data from " + file);

            if (VERSION != s.Version)
            {
                File.Delete(file);
                s = new MyStrings();
                settings = XmlSettings<MyStrings>.Bind(s, file);
            }
            return s;
        }
    }
}
